set grammar to oracle;
create sequence se increment by 2 start with 3 maxvalue 10 minvalue 2 cache 10;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
drop sequence se;
create sequence se increment by 2 start with 3 maxvalue 10 minvalue 2 nocycle cache 10;
drop sequence se;
create sequence se increment by 2 start with 3 maxvalue 8 minvalue 2 cycle;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
drop sequence se;
create sequence se  nomaxvalue nominvalue;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
drop sequence se;
create sequence se increment by 2 start with 3 maxvalue 8 minvalue 2 cycle cache 3;
drop sequence se;
create sequence se increment by 2 start with 3 maxvalue 8 minvalue 2 cycle cache 10;
drop sequence se;
create sequence se increment by 2 start with 3 maxvalue 8 minvalue 2 cache 10;
drop sequence se;
create sequence se increment by 2 start with 3 maxvalue 8 minvalue 2 cycle nocache;
drop sequence se;
create sequence se increment by 2 start with 3 maxvalue 8 minvalue 4 cycle;
drop sequence se;
create sequence se increment by 4 start with 9 maxvalue 8 minvalue 4 cycle;
drop sequence se;
create sequence se increment by 2 start with 10 maxvalue 10 minvalue 10 cycle;
drop sequence se;
create sequence se increment by 2 start with 10 nomaxvalue minvalue 1;
drop sequence se;
create sequence se increment by 2 start with 10 maxvalue 10 nominvalue ;
drop sequence se;
create sequence se  increment by -1 start with 10 maxvalue 10 minvalue 1 cycle cache 5;
drop sequence se;
create sequence se increment by 0 start with 1 maxvalue 10 minvalue 1 cycle;
drop sequence se;
create sequence se increment by 10 start with 1 maxvalue 10 minvalue 1 cycle;
drop sequence se;
create sequence se  increment by 1.0 maxvalue 4.0 minvalue 1.0 cycle cache 2;
drop sequence se;
create sequence se increment by 2 nomaxvalue  nominvalue nocycle;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
drop sequence se;
--修改序列
create sequence se increment by 1 start with 2 maxvalue 10 minvalue 2 cycle cache 2;
alter sequence se  start with 2;
select se.nextval from dual;
select se.currval from dual;
alter sequence se  maxvalue 100;
alter sequence se  minvalue 1;
alter sequence se  cache 3;
alter sequence se  increment by 2;
alter sequence se  nocycle;
select se.nextval from dual;
select se.currval from dual;
select se.nextval from dual;
select se.currval from dual;
drop sequence se;

